package com.fivefu.core.hik.dto.response;

import com.fivefu.base.common.utils.str.StrUtils;
import com.fivefu.core.hik.entity.DbHikCamera;

import java.math.BigDecimal;

public class HikCameraIncrementResp {


    /**
     * 唯一编码
     */
    private String indexCode;

    /**
     * 资源类型，camera：监控点
     */
    private String resourceType;

    /**
     * 监控点国标编号
     */
    private String externalIndexCode;

    /**
     * 资源名称
     */
    private String name;

    /**
     * 通道号，为级联监控点时，该字段为空；
     * 本级监控点时，该字段非空
     */
    private Integer chanNum;

    /**
     * 级联编号
     */
    private String cascadeCode;

    /**
     * 父级资源编号
     */
    private String parentIndexCode;

    /**
     * 经度，精确到小数点后8位
     */
    private BigDecimal longitude;

    /**
     * 纬度，精确到小数点后8位
     */
    private BigDecimal latitude;

    /**
     * 海拔高度，单位：米
     */
    private String elevation;

    /**
     * 监控点类型
     * 枪机0
     * 半球1
     * 快球2
     * 带云台枪机3
     */
    private Integer cameraType;

    /**
     * 能力集，详见附录A.44 设备能力集
     */
    private String capability;

    /**
     * 录像存储位置
     */
    private String recordLocation;

    /**
     * 通道子类型，
     * 模拟通道analog
     * 数字通道digital
     * 镜像通道mirror
     * 录播通道record
     * 零通道zero
     */
    private String channelType;

    /**
     * 所属区域
     */
    private  String regionIndexCode;

    /**
     * 传输协议，
     * 0：UDP
     * 1：TCP
     */
    private Integer transType;

    /**
     * 接入协议，详见附录A.6 编码设备接入协议
     */
    private String treatyType;

    /**
     * 安装位置，详见附录附录A.81 安装位置
     */
    private String installLocation;

    /**
     * 创建时间，IOS8601格式，参考附录B ISO8601时间格式说明
     */
    private String createTime;

    /**
     * 更新时间，IOS8601格式，参考附录B ISO8601时间格式说明
     */
    private String updateTime;

    /**
     * 状态小于0则代表资源已被删除
     */
    private String status;

    /**
     * 数据在界面上的显示顺序
     */
    private Integer disOrder;

    public String getIndexCode() {
        return indexCode;
    }

    public void setIndexCode(String indexCode) {
        this.indexCode = indexCode;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public String getExternalIndexCode() {
        return externalIndexCode;
    }

    public void setExternalIndexCode(String externalIndexCode) {
        this.externalIndexCode = externalIndexCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getChanNum() {
        return chanNum;
    }

    public void setChanNum(Integer chanNum) {
        this.chanNum = chanNum;
    }

    public String getCascadeCode() {
        return cascadeCode;
    }

    public void setCascadeCode(String cascadeCode) {
        this.cascadeCode = cascadeCode;
    }

    public String getParentIndexCode() {
        return parentIndexCode;
    }

    public void setParentIndexCode(String parentIndexCode) {
        this.parentIndexCode = parentIndexCode;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public String getElevation() {
        return elevation;
    }

    public void setElevation(String elevation) {
        this.elevation = elevation;
    }

    public Integer getCameraType() {
        return cameraType;
    }

    public void setCameraType(Integer cameraType) {
        this.cameraType = cameraType;
    }

    public String getCapability() {
        return capability;
    }

    public void setCapability(String capability) {
        this.capability = capability;
    }

    public String getRecordLocation() {
        return recordLocation;
    }

    public void setRecordLocation(String recordLocation) {
        this.recordLocation = recordLocation;
    }

    public String getChannelType() {
        return channelType;
    }

    public void setChannelType(String channelType) {
        this.channelType = channelType;
    }

    public String getRegionIndexCode() {
        return regionIndexCode;
    }

    public void setRegionIndexCode(String regionIndexCode) {
        this.regionIndexCode = regionIndexCode;
    }

    public Integer getTransType() {
        return transType;
    }

    public void setTransType(Integer transType) {
        this.transType = transType;
    }

    public String getTreatyType() {
        return treatyType;
    }

    public void setTreatyType(String treatyType) {
        this.treatyType = treatyType;
    }

    public String getInstallLocation() {
        return installLocation;
    }

    public void setInstallLocation(String installLocation) {
        this.installLocation = installLocation;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getDisOrder() {
        return disOrder;
    }

    public void setDisOrder(Integer disOrder) {
        this.disOrder = disOrder;
    }

    public DbHikCamera replaceDbHikCamera(){
        DbHikCamera camera = new DbHikCamera();
        camera.setCameraIndexCode(this.getIndexCode());//唯一编码
        camera.setGbIndexCode(this.externalIndexCode);//监控点国标编号
        camera.setCameraName(this.name);//资源名称
        camera.setChannelNo(this.chanNum == null ? "" : this.chanNum + "");//通道号，为级联监控点时，该字段为空；本级监控点时，该字段非空
        camera.setLatitude(this.latitude);//纬度，精确到小数点后8位
        camera.setLongitude(this.longitude);//经度，精确到小数点后8位
        camera.setElevation(this.elevation);//海拔高度，单位：米
        camera.setCameraType(this.cameraType == null ? "" : this.cameraType + "");//监控点类型
        camera.setCapability(this.capability);//能力集，详见附录A.44 设备能力集
        camera.setRecordLocation(this.recordLocation);//录像存储位置
        camera.setChannelType(this.channelType);//通道子类型
        camera.setRegionIndexCode(this.regionIndexCode);//所属区域
        camera.setTransType(this.transType == null ? "" : this.transType + "");//传输协议
        camera.setTreatyType(this.treatyType);//接入协议，详见附录A.6 编码设备接入协议
        camera.setInstallLocation(this.installLocation);//安装位置，详见附录附录A.81 安装位置
        camera.setCreateTime(this.createTime);//创建时间，IOS8601格式，参考附录B ISO8601时间格式说明
        camera.setUpdateTime(this.updateTime);//更新时间，IOS8601格式，参考附录B ISO8601时间格式说明
        camera.setCameraStatus(StrUtils.isNotNull(this.status) ? Integer.parseInt(this.status) : null);//状态小于0则代表资源已被删除
        camera.setDisOrder(this.disOrder);//数据在界面上的显示顺序
        return camera;
    }


}
